﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MMS.Respository
{
    /// <summary>
    /// EF容器工厂
    /// </summary>
    public  class EFFatory
    {
        //从线程中 操作数据
        //[ThreadStatic]//ThreadStatic 用来修饰静态变量：将此变量 存入 当前处理线程中！
        public static DbContext db = null;
        public static DbContext GetEFContext()
        {
            if (db == null) db = new MMSEntities();
            return db;
        }
    }
}
